From 3780e03570497d08a81bcc26a9e5d51b3e0c4e9f Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 19 Oct 2006 20:13:10 +0000 Subject: [PATCH] Fix interpolation when endpoints are same. From Vladimir Nadvornik. --- gpsbabel/grtcirc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gpsbabel/grtcirc.c b/gpsbabel/grtcirc.c index 48c227b99..44ecf1adf 100644 --- a/gpsbabel/grtcirc.c +++ b/gpsbabel/grtcirc.c @@ -286,6 +286,10 @@ void linepart(double lat1, double lon1, double phi = 0; double cosphi = 0; double sinphi = 0; + + /* result must be in degrees */ + *reslat = lat1; + *reslon = lon1; /* degrees to radians */ lat1 = RAD(lat1); lon1 = RAD(lon1); @@ -306,8 +310,6 @@ void linepart(double lat1, double lon1, ya /= la; za /= la; } - *reslat = lat1; - *reslon = lon1; /* if la is zero, the points are either equal or directly opposite * each other. Either way, there's no single geodesic, so we punt. */ if ( la ) { -- 2.30.2